using System;

namespace FreeFlow.Client
{
	/// <summary>
	/// An action available at a folder stage or from the blank forms list.
	/// </summary>
	[Serializable]
	public class Action
	{
		internal Action(string name, string actionType)
		{
      this.name = name;
      switch (actionType)
      {
        case "Confirm" :
          type = UserActionType.Confirm;
          break;
        case "Non-Confirm" :
          type = UserActionType.NonConfirm;
          break;
        case "Form" :
          type = UserActionType.Form;
          break;
        default :
          throw new FreeFlowException("Unrecognized action type - " + actionType);
      }
		}

    private UserActionType type;
    /// <summary>
    /// Gets the type of the action.
    /// </summary>
    public UserActionType Type
    {
      get
      {
        return type;
      }
    }

    private string name;
    /// <summary>
    /// Gets the name of the action.
    /// </summary>
    public string Name
    {
      get
      {
        return name;
      }
    }
	}
}
